package com.heima.listener;

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class TestListener {
    @KafkaListener(topics ="it-topic",groupId = "group01")
    public void getMessage1(String message){
        System.out.println("我是消费者1");
        System.out.println(message);
    }

    @KafkaListener(topics ="it-topic" ,groupId = "group02")
    public void getMessage2(String message){
        System.out.println("我是消费者2");
        System.out.println(message);
    }
}
